home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
dskut
/
timep37e.zip
/
TIMEPRK7.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-06-15
|
19KB
|
603 lines
; TIMEPRK7.ASM Version 3.70 *** 11 JUN 90 *** T.D. Cobb
;------------------------------------------------------------------------------
PAGE 60,132
;
; Assembles Under Tubro Asm Ver 1.0
;
; This TSR uses 73% Less Resident Memory (364% more efficient)
; (176 bytes verses 640) Than Mr. Zelkovitz's Vers 1.1
; Uses 32 bytes more if equated to save stack space (This should not
; be needed.)
;
; ******************************************************************************
; * Assembled Vers 3.7 HAS to be Converted to a binary file with EXE2BIN.EXE *
; * Before it can be load from CONFIG.SYS. (TIMEPARK.SYS already is) *
; * TIMEPARK.SYS HAS LOADED as a Device Driver *
; * DEVICE=TIMEPARK.SYS /Tn /S *
; * /Tn is Optional. Where "n" is 1 to 9 minutes & will reduce Display Message *
; * /S is Optional. This will totally suppress all of the Display Message. *
; ******************************************************************************
;
; Version 3 Should not lockup the keyboard on none XT class
; Machines Like My Pervious Vers 2 or Mr. Zelkovitz's Vers 1.
;
; Version 3.4 User can chose between Seek or Verify. It looks
; like some Cache's Do Not Seek if the track is already in cache.
; I would set "SEEK equ TRUE" if not using a Cache.
;
; Version 3.6 fixed floppy drive hang problem.
;
; Version 3.7 Put TSR in Device Drivers Clothing.
;
; Use and Enjoy and pass this on.
;
; Tom Cobb
; 130 Janice Dr.
; Athens, Ga 30606
; (404)543-8017
;
;The ARCHED distribution contains the following files:
;
; 1) TIMPARK1.ASM The assembly source
; 2) TIMEPARK.COM The load module
; 3) TIMEPARK.DOC Original miserable manual
; 4) TIMEPRK7.ASM this Assemble source
; 5) TIMEPRK7.SYS this Assembled source load module
;
;This software is placed in the PUBLIC DOMAIN to be used for NON-COMMERCIAL
;purposes only. You may freely copy and use it without any charge.
;
;This program must not be sold for profit. An adaequate fee may be
;requested for copying, shipping and handling when redistributing
;this program.
;
;Also, all five files MUST be passed on.
;
;The software is supplied AS IS and absolutely NO guarantees are given or
;implied about its suitability.
;
;
; Parts of this source code where written and placed in PUBLIC DOMAIN by
;
; ALPHA COMPUTER SERVICE
; ( Sanford J. Zelkovitz )
; 714-894-6808
;
; Christoph H. Hochstätter
; Carl-Strehl-Strasse 20
; D-3550 Marburg
; West-Germany
;
;
; Vers 2.06
; Worked on XT class machines. Used 208 Bytes Resident Memory
;
; Vers 3.00
; Changed verifys to seeks when parking drives
; Now parks on park cyl if roll over from lower 8 bits of Seek cyl
; Now enables interrupt Controller Chip so no keyboard lockup
; Changed TSR org Address so Code is on even memory boundary
;
; Vers 3.40
; Changed Int 1C so as not to Reenter it's self and
; Keep Better System Time
; Setup equate to chose between Seeks and Verifies
; Removed redundant park code
;
; Vers 3.50
; Moved test for already parked to front of TST code
;
; Vers 3.60
; Trap park code out while in Int 13
;
; Vers 3.70
; Placed TSR routine in Device driver form
; Setup equate to Save Caller Registers while parking drives
;
;------------------------------------------------------------------------------
;
; *************************
; these are general equates
; *************************
FALSE EQU 0 ; define logical values
TRUE EQU NOT FALSE
;*************************
SEEKS EQU FALSE ;* ; Set false for some Caches
;************************* ; SET True when No Cache in use
; by System
sav_stack EQU false ; If true uses 32 bytes more
; bytes of memory and takes some work off the stack while parking
; drives. This is something to try if you are sure this TSR is
; hanging system.
;
default_time EQU '3' ; Number of minutes delay to
; before parking if
; no "/Tn" Option used.
;
; ------------- Program Output Messages -------------
;
; Some non-display ASCII character values
CR EQU 0DH ; ASCII Carriage Return
LF EQU 0AH ; Line Feed
BEL EQU 07H
; Graphics characters for borders on the displays
V_BAR EQU 0BAH
H_BAR EQU 0CDH
U_LEFT EQU 0C9H
U_RIGHT EQU 0BBH
L_LEFT EQU 0C8H
L_RIGHT EQU 0BCH
TOP_T EQU 0CBH
BOT_T EQU 0CAH
;
; ------------ Our Flag Equates
parked_flag equ 0
;not_parked_flag equ not parked_flag
;out_of_our_code_flag equ 0
in_our_code_flag equ 1
in_int13_flag equ 80h
Cseg segment word public 'derice_dvr'
assume cs:Cseg, ds:Cseg, es:nothing, ss:nothing
;==============================================================================
org 0
;------------------------------------------------------------------------------
resident_park proc far
dd -1 ; No other device drivers
dw 1000000000000000b ; Character-Device
stra dw strategy ; Strategy-Routine
entr dw entry ; Interrupt-Routine
db '&TPARK37' ; Dummy-Name
error proc far
mov word ptr es:[bx+3],8103h ; Return ERROR status
retf ; if called twice
error endp ; by this Dummy-Device
;------------------------------------------------------------------------------
; if sav_stack
even ; make next address even
; endif
count dw 0 ; time delay counter
;==============================================================================
Ourint1c proc far
if sav_stack
mov word ptr cs:ax_sav,ax
else
push ax
endif
xor al,al
cmp al,0ffh
parked equ $-1 ; parked when set to zero
jz by_pass ; jmp if all ready parked
dec word ptr cs:count ; decrement time counter
jns by_pass ; now jmp if time left on counter
cmp al,0
busy equ $-1
jnz by_pass ; JMP so as not to
; reenter our code and
; don't park while int13 busy
; park both Hard drives
if sav_stack
or byte ptr cs:busy,in_our_code_flag
; Set to not Zero when
; in our park code
sti
mov word ptr cs:ds_sav,ds ; save regs to local area
; mov word ptr cs:ax_sav,ax
mov ax,cs
mov ds,ax
mov word ptr cx_sav,cx
mov word ptr bx_sav,bx
mov word ptr dx_sav,dx
mov word ptr si_sav,si
else
push ds ; save caller DS reg
sti
push cs
pop ds ;ds = this seg
or byte ptr busy,in_our_code_flag
; Set to not Zero when
; in our park code
push cx
push bx ; save regs
push dx
push si
endif
cli
mov al,20h ; Enable interrupt
out 20h,al ; Controller chip
sti
mov si,80h ; first hard disk
parkloop: mov ah,08
mov dx,si
int 13h ; get max cyl of hard disk
mov dx,si
inc ch
jnc less_512_cys_0
add cl,40h ; adjust upper 2 bits of cyl
; in bits 6-7
less_5